package atguigu;

import com.atguigu.bean.Boss;
import com.atguigu.bean.Car;
import com.atguigu.bean.Color;
import com.atguigu.config.MainConigOfAutowired;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author gcq
 * @Create 2020-09-25
 */
public class IOCTest_Autowired {
    AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConigOfAutowired.class);

    @Test
    public void test01() {
//        BookService bean = applicationContext.getBean(BookService.class);
//        System.out.println(bean);

//        BookDao bean1 = applicationContext.getBean(BookDao.class);
//        System.out.println(bean1);

        Boss boss = applicationContext.getBean(Boss.class);
        System.out.println(boss);
        Car car = applicationContext.getBean(Car.class);
        System.out.println(car);

        Color bean = applicationContext.getBean(Color.class);
        System.out.println(bean);

        applicationContext.close();
    }
}
